<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    /*平移效果与相对定位效果相当*/
    .p1{
        width: 200px;
        height: 200px;
        background: pink;
        transform: translate(50px,100px);
    }
    .p2{
        width: 200px;
        height: 200px;
        background: black;
    }
</style>
<body>
<div class="p1">
</div>
<div class="p2">

</div>
</body>
</html>